from color_config import *
from insert_video_control import insert_js
# from open_html import download_webm
from rank_bar import make_chart
from webm2mp4 import webm2mp4

if __name__ == '__main__':
    year = 2022
    month = 12
    play_interval = 800
    for industry in ['手机']:
    # for industry in ['汽车', '手机', '电脑办公', '家用电器', '化妆品', '旅游景点', '家具家居', '家装平台', '房产行业', '婴幼儿奶粉']:
        industry_en = INDUSTRY_DICT[industry]
        # 获取数据
        # get_monthly_data(industry_en, year, month)
        # 制图
        make_chart(industry, industry_en, year, month, COLOR_DICT[industry_en], play_interval)
        # # 插入video节点和录屏js
        insert_js(industry_en, year, month, play_interval)
        # # 打开html文件
        # download_webm(industry_en, year, month)
        # 下载完成之后获取视频并转为mp4
        # webm2mp4(industry_en, year, month)
